package com.wl.listener;

import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;

// web2.5版本前
public class AListener implements ServletRequestListener , ServletRequestAttributeListener {

    @Override
    public void requestDestroyed(ServletRequestEvent servletRequestEvent) {
        System.out.println("请求被销毁");
    }

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        System.out.println("请求被初始化");
    }

    @Override
    public void attributeAdded(ServletRequestAttributeEvent e) {
        System.out.println("请求添加了属性名:" + e.getName() + ",属性值：" + e.getValue());
    }

    @Override
    public void attributeRemoved(ServletRequestAttributeEvent e) {
        System.out.println("请求移除了属性名:" + e.getName() + ",属性值：" + e.getValue());
    }

    @Override
    public void attributeReplaced(ServletRequestAttributeEvent e) {
        System.out.println("请求替换了属性名:" + e.getName() + ",属性值：" + e.getValue());
    }
}
